<?php
class PrivilegiosController extends AppController {
    public $name = 'Privilegios';
    public $uses = array('Privilegios');
    public $components = array('Session');
    public $helpers = array('Html','Form'); 

public function index() {
   $this->layout = "principal";
   $this->set('title_for_layout', 'Privilegios' );
   }

public function catalogo() {
   $this->layout = "principal";
   $sql = "select * from privilegios ";
   if ($this->request->is('post')) {  
   $busquedapriv = $this->request->data;
   $sql = $sql."where nombrepriv like '%".$busquedapriv['Privilegios']['Nombre privilegio']."%'";
   }
   $Privilegios = $this->Privilegios->query($sql);
   $this->set('Privilegios', $Privilegios);
   }
 
}
?>